Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Food vouchers complement in MX #211

Merged
merged 4 commits into from
Oct 4, 2023
Merged

Food vouchers complement in MX #211

merged 4 commits into from
Oct 4, 2023

Conversation

cavalle
Copy link
Contributor

@cavalle cavalle commented Oct 3, 2023

  • Adds Food Vouchers complement to MX regime used to generate the CFDI's "ValesDeDespensa" complement.
  • Related to the Fuel Account Balance complement (Fuel account balance complement to MX regime #210)
  • The GOBL complements maps one by one to every node and field of the CFDI complement.
  • Implements validations according to the constrains of the the ValesDeDespensa spec.
  • Normalises all the amounts to the precision (2 decimals) specified in the ValesDeDespensa spec.
  • Calculates the grand total.

)
}

func validateFoodVouchersEmployee(value interface{}) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, you don't need to manually validate here. You just define the func (fve *FoodVoucersEmployee) Validate() error method and ensure the preceding structure includes the field definition:

    validation.Field(&line.Employee),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Addressed in cf73168

Copy link
Collaborator

@samlown samlown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! 👍

validation.Length(0, 20),
),
validation.Field(&fvl.IssueDateTime, cal.DateTimeNotZero()),
validation.Field(&fvl.Employee, validation.Required),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great now 👍

@cavalle cavalle changed the base branch from fuel-complement to main October 4, 2023 13:43
@cavalle cavalle merged commit c8c959d into main Oct 4, 2023
2 checks passed
@samlown samlown deleted the food-vouchers branch July 24, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants